local function hook_SG(sg)
    --【actionhandlers】    动作反馈状态
        do  --ATTACK
            local oldatkahds = sg.actionhandlers[ACTIONS.ATTACK].deststate
            sg.actionhandlers[ACTIONS.ATTACK].deststate = function(inst, action, ...)
                if inst.components.rider and inst.components.rider:IsRiding() then
                    return oldatkahds(inst, action, ...)
                end
                local weapon = inst.replica.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)   
                if weapon == nil then
                    return oldatkahds(inst, action, ...)
                end

                if weapon:HasTag("i26_laotie") then
                    if inst.components.i26skill and inst.components.i26skill:CanSuperAtk() then
                        return "i26superatk2"
                    else
                        return "i26superatk"
                    end
                end

                return oldatkahds(inst, action, ...)
            end
        end
        do  --CASTAOE
            local oldafn = sg.actionhandlers[ACTIONS.CASTAOE].deststate
            sg.actionhandlers[ACTIONS.CASTAOE].deststate = function(inst, action, ...)
                return action.invobject ~= nil and action.invobject:HasTag("i26_laotie") and action.doer:HasTag("i26") and "i26tlaotie" 
                or oldafn(inst, action, ...)
            end
        end
    -- 
end
local function hook_SG_c(sg)
    local oldatkahds = sg.actionhandlers[ACTIONS.ATTACK].deststate
    sg.actionhandlers[ACTIONS.ATTACK].deststate = function(inst, action, ...)
        if inst.replica.rider and inst.replica.rider:IsRiding() then
            return oldatkahds(inst, action, ...)
        end
        local weapon = inst.replica.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)   
        if weapon == nil then
            return oldatkahds(inst, action, ...)
        end
        if weapon:HasTag("i26_laotie") then
            if inst.replica.i26skill and inst:HasTag("i26sppatk") then
                return "i26superatk2"
            else
                return "i26superatk"
            end
        end

        return oldatkahds(inst, action, ...)
    end
    local oldCASTAOE = sg.actionhandlers[ACTIONS.CASTAOE].deststate
    sg.actionhandlers[ACTIONS.CASTAOE].deststate = function(inst, action, ...)
        return action.invobject ~= nil and action.invobject:HasTag("i26_laotie") and action.doer:HasTag("i26") and "i26tlaotie" 
        or oldCASTAOE(inst, action, ...)
    end
end
AddStategraphPostInit('wilson', hook_SG) 
AddStategraphPostInit('wilson_client', hook_SG_c) 